//
//  HomePageCell.m
//  LastTemp
//
//  Created by dllo on 15/4/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "HomePageCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
#define heigh 150
@implementation HomePageCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.scrollerView = [[UIScrollView alloc] init];
        [self.contentView addSubview:self.scrollerView];
        [_scrollerView release];
        
        self.imageViewOne = [[UIImageView alloc] init];
        [self.scrollerView addSubview:self.imageViewOne];
        [_imageViewOne release];
        
        self.imageViewTwo = [[UIImageView alloc] init];
        [self.scrollerView addSubview:self.imageViewTwo];
        [_imageViewTwo release];
        
        self.imageViewThree = [[UIImageView alloc] init];
        [self.scrollerView addSubview:self.imageViewThree];
        [_imageViewThree release];
        
        self.imageViewFour = [[UIImageView alloc] init];
        [self.scrollerView addSubview:self.imageViewFour];
        [_imageViewFour release];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.scrollerView.frame = CGRectMake(0, 0, self.contentView.frame.size.width, heigh);
    self.scrollerView.contentSize = CGSizeMake(WIDTH*4, heigh);
    self.imageViewOne.frame = CGRectMake(0, 0, WIDTH, heigh);
    self.imageViewTwo.frame = CGRectMake(WIDTH, 0, WIDTH, heigh);
    self.imageViewThree.frame = CGRectMake(WIDTH*2, 0, WIDTH, heigh);
    self.imageViewFour.frame = CGRectMake(WIDTH*3, 0, WIDTH, heigh);
    self.scrollerView.pagingEnabled = YES;
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
